<layout name="page" />
<block name="content">
	{:widget('page_header/adv_search',array('name'=>'任务列表'))}

	<div id="adv_search" class="hidden">
		<form method="post" name="form_adv_search" id="form_adv_search">
			<div id="adv_search_header" class="row" style="">
				<h1 style="">高级搜索</h1>
				<i class="x1" class=""></i>
				<a class="btn btn-normal" id="submit_adv_search">搜索</a>
				<a class="btn btn-return" id="close_adv_search">关闭</a>
			</div>
			<div class="row" id="adv_search_body" >
				<div class="box col-6">
					<label class=" input-label" for="li_name">任务名称：</label>
					<input  class="input" type="text" id="li_name" name="li_name" >
				</div>
				<div class="box col-6">
					<label class="input-label" >指派人：</label>
					<input  class="input" type="text" id="eq_user_name" name="eq_user_name" >
				</div>
				<div class="box col-6">
					<label class="input-label" for="eq_user_name">执行人：</label>
					<input  class="input" type="text" id="eq_executor_name" name="eq_executor_name" >
				</div>
				<div class="box col-6">
					<label class="input-label">状态：</label>
					<select class="select col-16" name="eq_is_finish" id="eq_is_finish">
						<option >请选择</option>
						<option value="0">待办中</option>
						<option value="1">进行中</option>
						<option value="2">延迟</option>
						<option value="3">已完成</option>
						<option value="4">已关闭</option>
					</select>
					<i class="icon"></i>
				</div>
			</div>
		</form>
	</div>
	<div class="sub">
		<div class="table">
			<ul>
				<li class="thead">
					<span class="w5">编号</span>
					<span class="w20 x1">项目名称</span>
					<span class="w20 x1">任务名称</span>
					<span class="w6 ">工作量</span>
					<span class="w10 ">截至日期</span>
					<span class="w10 ">完成日期</span>
					<span class="w8">状态</span>
					<span class="w8 ">指派人</span>
					<span class="w8 ">执行人</span>
					<span class="w6 ">附件</span>
				</li>
				<foreach name="list" val="task">
					<li class="tbody">
						<span class="w5">{$task.id}</span>
						<span class="w20 x1">{$task.project_name}</span>
						<span class="w20 x1"><a href="{:url('read_task',array('id'=>$task['id']))}">{$task.name}</a>&nbsp;</span>
						<span class="w6">{$task.workload}</span>
						<span class="w10">{$task.end_date}</span>
						<span class="w10 ">{$task.finish_date}</span>
						<span class="w8">{:project_is_finish($task['is_finish'])}</span>
						<span class="w8">{$task.user_name}</span>
						<span class="w8">{$task.executor_name}</span>
						<if condition="empty($task['task_file'])">
							<span class="w6"> </span>
							<else/>
							<span class="w6"><a><b onclick="download('{$task['task_file']}')">下载</b></a></span>
						</if>
					</li>
				</foreach>
			</ul>
		</div>
		{$page}
	</div>
</block>

<block name="js">
	<script>
		layui.use(['global', 'editor'], function() {
			var $ = layui.jquery;
			set_return_url();
			set_val('is_finish', '{$vo.is_finish}');

		});

		function download(file) {
			winopen("{:url('download')}?file=" + file, 560, 470);
		}
	</script>
</block>
